package com.iweb.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author jack
 * @since 2020-05-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_article")
public class Article extends Model<Article> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("id")
    private String id;

    /**
     * 用户id
     */
    @TableField("user_id")
    private String userId;

    /**
     * 博客标题
     */
    @TableField("title")
    private String title;

    /**
     * 文章内容
     */
    @TableField("content")
    private String content;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 是否公开 0 false 1 true
     */
    @TableField("is_public")
    private String isPublic;

    /**
     * 是否置顶 0 false 1 true
     */
    @TableField("is_top")
    private String isTop;

    /**
     * 访问量
     */
    @TableField("visits")
    private Integer visits;

    /**
     * 点赞数
     */
    @TableField("thumb_up")
    private Integer thumbUp;

    /**
     * 评论数
     */
    @TableField("comment_count")
    private Integer commentCount;

    /**
     * 频道
     */
    @TableField("channel_id")
    private String channelId;

    /**
     * url
     */
    @TableField("url")
    private String url;

    /**
     * 类型 0 原创 1 分享
     */
    @TableField("type")
    private String type;

    @TableField(exist = false)
    private Member member;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
